// $Id$
using System;
using System.Data;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Salamanca.DataAccess;
using Salamanca.DataAccess.Collections;

namespace Northwind.DomainModel.EnterpriseLibrary
{

    /// <summary />
    public static partial class Mappers
    {

        /// <summary />
        public static DataMapperCollection CreateDataMapperCollection(Database database, ICacheManager cacheManager)
        {
            DataMapperCollection ret=new DataMapperCollection();
            ret.Add(typeof(Category), new CategoryMapper(database, cacheManager ?? Category.IdentityMap.CacheManager));
            ret.Add(typeof(Customer), new CustomerMapper(database, cacheManager ?? Customer.IdentityMap.CacheManager));
            ret.Add(typeof(Employee), new EmployeeMapper(database, cacheManager ?? Employee.IdentityMap.CacheManager));
            ret.Add(typeof(Order), new OrderMapper(database, cacheManager ?? Order.IdentityMap.CacheManager));
            ret.Add(typeof(Product), new ProductMapper(database, cacheManager ?? Product.IdentityMap.CacheManager));
            ret.Add(typeof(Shipper), new ShipperMapper(database, cacheManager ?? Shipper.IdentityMap.CacheManager));
            ret.Add(typeof(Supplier), new SupplierMapper(database, cacheManager ?? Supplier.IdentityMap.CacheManager));
            ret.Add(typeof(OrderDetails), new OrderDetailsMapper(database, cacheManager ?? OrderDetails.IdentityMap.CacheManager));

            return ret;
        }
    }

}
